<?php
class  ApiCenter_VendorsApi_Model_Api2_Warehouse_Rest extends ApiCenter_VendorsApi_Model_Api2_Warehouse{
 
    
    
    
    protected  function _getCollectionForRetrieve($vendorId,$wid=null){
        
        
        /** @var $collection ApiCenter_VendorsApi_Model_Resource_Mysql4_Address_Collection */
          
            $collection =   Mage::getResourceModel("vendorswarehouse/address_collection");
            if($wid){
                $collection->addFieldToFilter("main_table.entity_id",$wid);
            }
            $collection->addFieldToFilter("main_table.vendor_id",$vendorId);
            $collection->getSelect()
                               ->join(array("d"=>"ves_vendor_warehouse_details"),
                                   "main_table.entity_id=d.wid"  
                                   );
            return $collection;
    }
    
}